module.exports = function throttleFn(fn, delay) {
    let timer = null;
    return function () {
        let context = this, args = arguments;
        timer && clearTimeout(timer);
        timer = setTimeout(function () {
            fn.apply(context, args);
        }, delay)
    }
}